<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>编辑应用</title>
    <link href="${base}/resource/admin/css/common.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="${base}/resource/admin/js/jquery.js"></script>
    <script type="text/javascript" src="${base}/resource/admin/js/jquery.validate.js"></script>
    <script type="text/javascript" src="${base}/resource/admin/js/common.js"></script>
    <script type="text/javascript" src="${base}/resource/admin/js/input.js"></script>
    <script type="text/javascript">


        $().ready(function() {

            var $inputForm = $("#inputForm");
        [@flash_message /]
            $("#complaintTemplate").browser({type:"file"});

            //生成AppID
            $("#generateAppID").click(function(){
                ajaxToDo("generateAppID.do",function(json){
                    $("input[name='appID']").val(json.content);
                });
            });

            //生成AppIey
            $("#generateAppKey").click(function(){
                ajaxToDo("generateAppKey.do",function(json){
                    $("input[name='appKey']").val(json.content);
                });
            });

        });
    </script>
</head>
<body>
<div class="path">
    <a href="${base}/admin/common/index.do">首页</a> &raquo;添加应用
</div>
<form id="inputForm" action="update.do" method="post" class="required-form" onsubmit="return validateForm(this)">
    <input type="hidden" name="id" value="${entity.id}"/>
    <input type="hidden" name="smsCount" value="${entity.smsCount}"/>
    <table class="input">
        <tr>
            <th>
                <span class="requiredField">*</span>客户:
            </th>
            <td>
                <input type="hidden" name="customer.id" value="${entity.customer.id}"/>
                ${entity.customer.name}
            </td>
        </tr>
        <tr>
            <th>
                <span class="requiredField">*</span>App名称
            </th>
            <td>
                <input type="text" name="name" class="text required" maxlength="100" value="${entity.name}" />
            </td>
        </tr>
        <tr>
            <th>
                <span class="requiredField">*</span>AppID
            </th>
            <td>
                <span class="fieldSet">
                       ${entity.appID}
					    <input type="hidden" name="appID" class="text required" minlength="16" maxlength="64"  value="${entity.appID}"/>
				</span>
            </td>
        </tr>
        <tr>
            <th>
                <span class="requiredField">*</span>AppKey
            </th>
            <td>
                    <span class="fieldSet">
						<input type="text" name="appKey" class="text required" minlength="16" maxlength="64"  value="${entity.appKey}" />
						<input type="button" id="generateAppKey" class="button" value="生成" />
					</span>
            </td>
        </tr>
        <tr>
            <th>
                <span class="requiredField">*</span>App识别码
            </th>
            <td>
                    <span class="fieldSet">
						<input type="text" name="appCode" value="${entity.appCode}" class="text required" maxlength="4" />
					</span>
            </td>
        </tr>
        <tr>
            <th>
                <span class="requiredField">*</span>离线通知地址
            </th>
            <td>
                    <span class="fieldSet">
						<input type="text" name="offlineNotifyUrl"  value="${entity.offlineNotifyUrl}" class="text" maxlength="64" />
					</span>
            </td>
        </tr>
        <tr>
            <th>
                <span class="requiredField">*</span>包月通知地址
            </th>
            <td>
                    <span class="fieldSet">
						<input type="text" name="monthNotifyUrl" value="${entity.monthNotifyUrl}" class="text" maxlength="64" />
					</span>
            </td>
        </tr>
        <tr>
            <th>
                <span class="requiredField">*</span>SDK计费结果通知地址
            </th>
            <td>
                    <span class="fieldSet">
						<input type="text" name="woStoreNotifyUrl" value="${entity.woStoreNotifyUrl}" class="text" maxlength="64" />
					</span>
            </td>
        </tr>
        <tr>
            <th>
                说明
            </th>
            <td>
                <input type="text" name="description" class="text required" maxlength="100" value="${entity.description}" />
            </td>
        </tr>
        <tr>
            <th>
                <span class="requiredField">*</span>sms剩余条数:
            </th>
            <td>
                <span class="fieldSet">
						[#--<input type="text" name="smsCount" class="text required" minlength="16" maxlength="64"  value="${entity.smsCount}" disabled="disabled" />--]
                        ${entity.smsCount}
						<a href="rechargeSms.do?id=${entity.id}" class="button" >充值</a>
				</span>
            </td>
        </tr>
        <tr>
            <th>
                <span class="requiredField">*</span>是否启用:
            </th>
            <td>
                <select name="enabled" class="required">
                    <option value="1" [#if entity.enabled]selected="selected" [/#if]>是</option>
                    <option value="0" [#if entity.enabled==false]selected="selected" [/#if]>否</option>
                </select>
            </td>
        </tr>
        <tr>
            <th>
                日请求次数上限
            </th>
            <td>
                <input type="text" name="allowDayCount" class="text required" maxlength="100" value="${entity.allowDayCount}"/>
            </td>
        </tr>
        <tr>
            <th>
                <span class="requiredField">*</span>投诉模板
            </th>
            <td>
                    <span class="fieldSet">
					    <input type="text" name="complaintTemplate" class="text" value="${entity.complaintTemplate}" maxlength="200"  />
					    <input type="button" id="complaintTemplate" class="button" alt="60" value="选择" />
			        </span>
            </td>
        </tr>
        <tr>
            <th>
                &nbsp;
            </th>
            <td>
                <input type="submit" class="button" value="提交" />
                <input type="button" class="button" value="返回" onclick="location.href='list.do'" />
            </td>
        </tr>
    </table>
</form>
</body>
</html>